namespace LeadThing.AbpZeroTemplate.Migrations
{
    using System;
    using System.Collections.Generic;
    using System.Data.Entity.Infrastructure.Annotations;
    using System.Data.Entity.Migrations;

    public partial class Add_BasicPerson : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "Basic.Area",
                c => new
                {
                    Id = c.Long(nullable: false, identity: true),
                    Code = c.String(maxLength: 50),
                    Title = c.String(maxLength: 100),
                    ParentId = c.Int(nullable: false),
                    FirstLetter = c.String(maxLength: 50),
                    Level = c.Int(nullable: false),
                    Point = c.String(maxLength: 100),
                    Households = c.Int(nullable: false),
                    PersonNum = c.Int(nullable: false),
                    IsDeleted = c.Boolean(nullable: false),
                    DeleterUserId = c.Long(),
                    DeletionTime = c.DateTime(),
                    LastModificationTime = c.DateTime(),
                    LastModifierUserId = c.Long(),
                    CreationTime = c.DateTime(nullable: false),
                    CreatorUserId = c.Long(),
                },
                annotations: new Dictionary<string, object>
                {
                    { "DynamicFilter_Area_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
                })
                .PrimaryKey(t => t.Id);

            CreateTable(
                "Basic.BasicPerson",
                c => new
                {
                    Id = c.Long(nullable: false, identity: true),
                    Name = c.String(maxLength: 50),
                    Sex = c.Boolean(nullable: false),
                    IDCard = c.String(maxLength: 18),
                    TotalPopulation = c.Int(nullable: false),
                    Relationship = c.String(maxLength: 50),
                    Industry = c.String(maxLength: 100),
                    ContractField = c.String(maxLength: 50),
                    ResponsibilityField = c.String(maxLength: 50),
                    HouseNumber = c.String(maxLength: 50),
                    Building = c.String(maxLength: 50),
                    Bungalow = c.String(maxLength: 50),
                    Politics = c.String(maxLength: 50),
                    IsMartyr = c.Boolean(nullable: false),
                    Isallowance = c.Boolean(nullable: false),
                    IsLonely = c.Boolean(nullable: false),
                    Iselderly = c.Boolean(nullable: false),
                    IsFiveGuarantees = c.Boolean(nullable: false),
                    TownID = c.Int(nullable: false),
                    AreaID = c.Int(nullable: false),
                    VillageID = c.Int(nullable: false),
                    IsDeleted = c.Boolean(nullable: false),
                    DeleterUserId = c.Long(),
                    DeletionTime = c.DateTime(),
                    LastModificationTime = c.DateTime(),
                    LastModifierUserId = c.Long(),
                    CreationTime = c.DateTime(nullable: false),
                    CreatorUserId = c.Long(),
                },
                annotations: new Dictionary<string, object>
                {
                    { "DynamicFilter_BasicPerson_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
                })
                .PrimaryKey(t => t.Id);

            CreateTable(
                "Basic.DisputeType",
                c => new
                {
                    Id = c.Long(nullable: false, identity: true),
                    Title = c.String(maxLength: 50),
                    Remarks = c.String(maxLength: 500),
                    IsDeleted = c.Boolean(nullable: false),
                    DeleterUserId = c.Long(),
                    DeletionTime = c.DateTime(),
                    LastModificationTime = c.DateTime(),
                    LastModifierUserId = c.Long(),
                    CreationTime = c.DateTime(nullable: false),
                    CreatorUserId = c.Long(),
                },
                annotations: new Dictionary<string, object>
                {
                    { "DynamicFilter_DisputeType_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
                })
                .PrimaryKey(t => t.Id);

            CreateTable(
                "Basic.File",
                c => new
                {
                    Id = c.Long(nullable: false, identity: true),
                    DisID = c.Int(nullable: false),
                    Title = c.String(maxLength: 50),
                    Extension = c.String(maxLength: 20),
                    Size = c.Int(nullable: false),
                    Url = c.String(maxLength: 500),
                    IsDeleted = c.Boolean(nullable: false),
                    DeleterUserId = c.Long(),
                    DeletionTime = c.DateTime(),
                    LastModificationTime = c.DateTime(),
                    LastModifierUserId = c.Long(),
                    CreationTime = c.DateTime(nullable: false),
                    CreatorUserId = c.Long(),
                },
                annotations: new Dictionary<string, object>
                {
                    { "DynamicFilter_File_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
                })
                .PrimaryKey(t => t.Id);

            CreateTable(
                "Basic.GridPerson",
                c => new
                {
                    Id = c.Long(nullable: false, identity: true),
                    PersonName = c.String(maxLength: 50),
                    PersonPhone = c.String(maxLength: 11),
                    IDCard = c.String(maxLength: 18),
                    CensusRegister = c.String(maxLength: 500),
                    Remarks = c.String(maxLength: 4000),
                    GridName = c.String(maxLength: 50),
                    GridPhone = c.String(maxLength: 11),
                    AssistName = c.String(maxLength: 50),
                    AssistPhone = c.String(maxLength: 11),
                    PersonTypeID = c.Int(nullable: false),
                    IsArmy = c.Boolean(nullable: false),
                    Address = c.String(maxLength: 500),
                    WordSituation = c.String(maxLength: 500),
                    IsDeleted = c.Boolean(nullable: false),
                    DeleterUserId = c.Long(),
                    DeletionTime = c.DateTime(),
                    LastModificationTime = c.DateTime(),
                    LastModifierUserId = c.Long(),
                    CreationTime = c.DateTime(nullable: false),
                    CreatorUserId = c.Long(),
                },
                annotations: new Dictionary<string, object>
                {
                    { "DynamicFilter_GridPerson_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
                })
                .PrimaryKey(t => t.Id);

            CreateTable(
                "Basic.PersonType",
                c => new
                {
                    Id = c.Long(nullable: false, identity: true),
                    Name = c.String(maxLength: 50),
                    Remarks = c.String(maxLength: 500),
                    IsDeleted = c.Boolean(nullable: false),
                    DeleterUserId = c.Long(),
                    DeletionTime = c.DateTime(),
                    LastModificationTime = c.DateTime(),
                    LastModifierUserId = c.Long(),
                    CreationTime = c.DateTime(nullable: false),
                    CreatorUserId = c.Long(),
                },
                annotations: new Dictionary<string, object>
                {
                    { "DynamicFilter_PersonType_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
                })
                .PrimaryKey(t => t.Id);

            CreateTable(
                "Basic.SpecialPerson",
                c => new
                {
                    Id = c.Long(nullable: false, identity: true),
                    Name = c.String(maxLength: 50),
                    Phone = c.String(maxLength: 11),
                    IDCard = c.String(maxLength: 18),
                    Sex = c.Boolean(nullable: false),
                    Nation = c.String(maxLength: 50),
                    Health = c.String(maxLength: 50),
                    Politics = c.String(maxLength: 50),
                    Culture = c.String(maxLength: 50),
                    PersonTypeID = c.Int(nullable: false),
                    Community = c.String(maxLength: 100),
                    Village = c.String(maxLength: 100),
                    Address = c.String(maxLength: 500),
                    IsDeleted = c.Boolean(nullable: false),
                    DeleterUserId = c.Long(),
                    DeletionTime = c.DateTime(),
                    LastModificationTime = c.DateTime(),
                    LastModifierUserId = c.Long(),
                    CreationTime = c.DateTime(nullable: false),
                    CreatorUserId = c.Long(),
                },
                annotations: new Dictionary<string, object>
                {
                    { "DynamicFilter_SpecialPerson_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
                })
                .PrimaryKey(t => t.Id);

        }

        public override void Down()
        {
            DropTable("Basic.SpecialPerson",
                removedAnnotations: new Dictionary<string, object>
                {
                    { "DynamicFilter_SpecialPerson_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
                });
            DropTable("Basic.PersonType",
                removedAnnotations: new Dictionary<string, object>
                {
                    { "DynamicFilter_PersonType_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
                });
            DropTable("Basic.GridPerson",
                removedAnnotations: new Dictionary<string, object>
                {
                    { "DynamicFilter_GridPerson_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
                });
            DropTable("Basic.File",
                removedAnnotations: new Dictionary<string, object>
                {
                    { "DynamicFilter_File_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
                });
            DropTable("Basic.DisputeType",
                removedAnnotations: new Dictionary<string, object>
                {
                    { "DynamicFilter_DisputeType_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
                });
            DropTable("Basic.BasicPerson",
                removedAnnotations: new Dictionary<string, object>
                {
                    { "DynamicFilter_BasicPerson_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
                });
            DropTable("Basic.Area",
                removedAnnotations: new Dictionary<string, object>
                {
                    { "DynamicFilter_Area_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
                });
        }
    }
}
